#ifndef ROBOTCONTROLFORM_H
#define ROBOTCONTROLFORM_H

#include "dragbutton.h"
#include "telemetrydialog.h"
#include <QAbstractButton>
#include <QButtonGroup>
#include <QWidget>
#include <jointdatadialog.h>
#include <models/robot.h>
namespace Ui {
class RobotControlForm;
}

class RobotControlForm : public QWidget
{
    Q_OBJECT
public:
    explicit RobotControlForm(QWidget *parent = nullptr);
    ~RobotControlForm();

signals:
    void exitControl();
    void gobackList();
private slots:
    void on_about_btn_clicked();

    void on_exit_btn_clicked();

    void onSwitchControl(QAbstractButton *button);

    void onSwitchPage(int nID,bool b);

    void onWarningChanged(QString strWarning);

    void on_goback_btn_clicked();

    void updateData();

    void on_enable_btn_clicked();

    void on_pushButton_toggled(bool checked);

    void on_zero_btn_clicked();

    void on_disable_btn_clicked();

    void onAudioBtnChecked(bool bChecked);

    void on_telemetry_btn_clicked();

private:
    void scaleWidgets(QWidget *widget, double xScale,double yScale);
    Ui::RobotControlForm *ui;
    QButtonGroup *m_pButtonGroup;

    int m_curTabType=AUTO_PAGE;
    JointDataDialog * m_pJointWidget;
    DragButton *m_pSpeakBtn;
    //bool m_bFirst=true;
    TelemetryDialog * m_pTelemetryDlg;
    // QWidget interface
protected:
    void showEvent(QShowEvent *event);
    void hideEvent(QHideEvent *event);

    // QWidget interface
protected:
    void resizeEvent(QResizeEvent *event);
};

#endif // ROBOTCONTROLFORM_H
